﻿@model FCTC_Web.Models.TeamMember

<script type="text/javascript">
    $(document).ready(function () {
        $(":button").click(function () {
            $this = $(this);
            var teamid = $('#ID').val();
            var memberid = $('#MemberID').val();
            
            var memberFullName = $('#MemberFullName').val();
            var gender = $('#Gender').val();
            var identity = $('#Identity').val();
            var memberStatus = $('#MemberStatus').val();
            var hasVehicle = $('#HasVehicle').val();
            var sequense = $('#Sequense').val();

            var value = $this.val();
            if (value == "保存") {
               
                $.ajax({
                    url: "/Team/MemberUpdate",
                    datatype: "html",
                    type: 'POST',
                    traditional: true,
                    data:
                          {
                              'teamid': teamid,
                              'memberid':memberid,
                              'memberFullName': memberFullName,
                              'gender': gender,
                              'identity': identity,
                              'memberStatus': memberStatus,
                              'hasVehicle': hasVehicle,
                              'sequense': sequense
                          },
                    success: function (result) {
                        $('#memberlist').html(result);
                    }
                });
            }
        });
    });
</script>

        @if (Model != null)
        {
            @Html.Hidden("MemberID",Model.ID)
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.MemberFullName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MemberFullName)
            @Html.ValidationMessageFor(model => model.MemberFullName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gender)
        </div>
        <div class="editor-field">
           @Html.DropDownListFor(model => model.Gender, new SelectList(new List<string>{  
                       "男", 
                       "女"}),"--请选择--")
            @Html.ValidationMessageFor(model => model.Gender)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Identity)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Identity)
            @Html.ValidationMessageFor(model => model.Identity)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MemberStatus)
        </div>
        <div class="editor-field">
             @Html.DropDownListFor(model => model.MemberStatus, new SelectList(new List<string>{  
                       "参赛中", 
                       "弃权",
                       "其他"}), "--请选择--")
            @Html.ValidationMessageFor(model => model.MemberStatus)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.HasVehicle)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.HasVehicle)
            @Html.ValidationMessageFor(model => model.HasVehicle)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sequense)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sequense)
            @Html.ValidationMessageFor(model => model.Sequense)
        </div>

        <p>
            <input type="button" value="保存" />
        </p>



